export const ProtocolEvent = {
  RECEIVE_MESSAGE: Symbol('PROTOCOL_RECEIVE_MESSAGE'),
  DELIVER_MESSAGE: Symbol('PROTOCOL_DELIVER_MESSAGE'),
  KICK_OUT_USER: Symbol('PROTOCOL_KICK_OUT_USER'),
  CONN_ESTABLISHED: Symbol('CONN_ESTABLISHED'),
  CONN_FAILED: Symbol('CONN_FAILED'),
  CONN_STATE_CHANGE: Symbol('CONN_STATE_CHANGE'),
};

export const ConnectionEvent = {
  CLOSED: Symbol('CLOSED'),
  OPENED: Symbol('OPENED'),
  MESSAGE: Symbol('MESSAGE'),
  ERROR: Symbol('ERROR'),
};

export const MessageEvents = {
  RECEIVED: Symbol('MESSAGE_RECEIVED'),
  WITHDRAW: Symbol('MESSAGE_WITHDRAW'),
  SIGNAL: Symbol('MESSAGE_SIGNAL'),
  SYSTEM: Symbol('MESSAGE_SYSTEM'),
};

export const ErrorEvents = {
  PROTOCOL_ERROR: Symbol('PROTOCOL_ERROR'),
  CONNECTION_ERROR: Symbol('BUSINESS_ERROR'),
};

// 业务用户类型: 1-内部用户(麒麟), 2-门店，3-供应商，4-消费者
export const UserType = {
  INTERNAL: '1',
  STORE: '2',
  VENDOR: '3',
  CONSUMER: '4',
};

export const MessageType = {
  TEXT: 1,
  IMAGE: 2,
  VOICE: 3,
  VIDEO: 4,
  CARD: 5,
  IMG_TEXT: 6,
  FILE: 7,
  WITHDRAW: 98,
  SYSTEM: 99,
  SIGNAL: 100,
};

export const SignalType = {
  ADD_STORE_USER: 'ADD_STORE_USER', // 添加门店
  REMOVE_USER: 'REMOVE_USER', // 移出群
  ADD_ADMIN: 'ADD_ADMIN', // 创建群向管理员发送信息
  CHANGE_ADMIN: 'CHANGE_ADMIN', // 编辑群向变更管理员
  ANNOUNCEMENT: 'ANNOUNCEMENT', // 群公告
  MUTE: 'MUTE', // 禁言
  SOLVE: 'SOLVE', // 解禁
};
